package c.d.a.a.h;

import android.graphics.Matrix;
import android.util.Log;
import android.view.MotionEvent;
import android.view.VelocityTracker;
import c.d.a.a.f.b.b;
import c.d.a.a.j.d;
import c.d.a.a.j.g;
import c.d.a.a.j.h;
import com.github.mikephil.charting.charts.BarLineChartBase;
import com.github.mikephil.charting.charts.Chart;
import com.github.mikephil.charting.data.Entry;
import java.util.Objects;

/* compiled from: BarLineChartTouchListener */
public class a extends b<BarLineChartBase<? extends c.d.a.a.c.a<? extends b<? extends Entry>>>> {
    public Matrix f = new Matrix();
    public Matrix g = new Matrix();
    public d h = d.b(0.0f, 0.0f);
    public d i = d.b(0.0f, 0.0f);
    public float j = 1.0f;
    public float k = 1.0f;
    public float l = 1.0f;
    public c.d.a.a.f.b.d m;
    public VelocityTracker n;
    public long o = 0;
    public d p = d.b(0.0f, 0.0f);
    public d q = d.b(0.0f, 0.0f);
    public float r;
    public float s;

    public a(BarLineChartBase<? extends c.d.a.a.c.a<? extends b<? extends Entry>>> barLineChartBase, Matrix matrix, float f) {
        super(barLineChartBase);
        this.f = matrix;
        this.r = g.d(f);
        this.s = g.d(3.5f);
    }

    public static float f(MotionEvent motionEvent) {
        float x = motionEvent.getX(0) - motionEvent.getX(1);
        float y = motionEvent.getY(0) - motionEvent.getY(1);
        return (float) Math.sqrt((double) ((y * y) + (x * x)));
    }

    public d b(float f, float f2) {
        h viewPortHandler = ((BarLineChartBase) this.e).getViewPortHandler();
        f -= viewPortHandler.b.left;
        c();
        return d.b(f, -((((float) ((BarLineChartBase) this.e).getMeasuredHeight()) - f2) - viewPortHandler.l()));
    }

    public final boolean c() {
        if (this.m == null) {
            BarLineChartBase barLineChartBase = (BarLineChartBase) this.e;
            Objects.requireNonNull(barLineChartBase.b0);
            Objects.requireNonNull(barLineChartBase.c0);
        }
        c.d.a.a.f.b.d dVar = this.m;
        if (dVar != null) {
            ((BarLineChartBase) this.e).o(dVar.e0());
        }
        return false;
    }

    public final void d(MotionEvent motionEvent, float f, float f2) {
        this.a = c.d.a.a.h.b.a.DRAG;
        this.f.set(this.g);
        c onChartGestureListener = ((BarLineChartBase) this.e).getOnChartGestureListener();
        c();
        this.f.postTranslate(f, f2);
        if (onChartGestureListener != null) {
            onChartGestureListener.d(motionEvent, f, f2);
        }
    }

    public final void e(MotionEvent motionEvent) {
        this.g.set(this.f);
        this.h.b = motionEvent.getX();
        this.h.c = motionEvent.getY();
        BarLineChartBase barLineChartBase = (BarLineChartBase) this.e;
        c.d.a.a.e.b f = barLineChartBase.f(motionEvent.getX(), motionEvent.getY());
        this.m = f != null ? (b) ((c.d.a.a.c.a) barLineChartBase.b).c(f.f) : null;
    }

    public void g() {
        d dVar = this.q;
        dVar.b = 0.0f;
        dVar.c = 0.0f;
    }

    public boolean onDoubleTap(MotionEvent motionEvent) {
        this.a = c.d.a.a.h.b.a.DOUBLE_TAP;
        c onChartGestureListener = ((BarLineChartBase) this.e).getOnChartGestureListener();
        if (onChartGestureListener != null) {
            onChartGestureListener.b(motionEvent);
        }
        Chart chart = this.e;
        if (((BarLineChartBase) chart).J && ((c.d.a.a.c.a) ((BarLineChartBase) chart).getData()).e() > 0) {
            d b = b(motionEvent.getX(), motionEvent.getY());
            Chart chart2 = this.e;
            BarLineChartBase barLineChartBase = (BarLineChartBase) chart2;
            float f = 1.4f;
            float f2 = ((BarLineChartBase) chart2).N ? 1.4f : 1.0f;
            if (!((BarLineChartBase) chart2).O) {
                f = 1.0f;
            }
            float f3 = b.b;
            float f4 = b.c;
            h hVar = barLineChartBase.t;
            f4 = -f4;
            Matrix matrix = barLineChartBase.l0;
            Objects.requireNonNull(hVar);
            matrix.reset();
            matrix.set(hVar.a);
            matrix.postScale(f2, f, f3, f4);
            barLineChartBase.t.n(barLineChartBase.l0, barLineChartBase, false);
            barLineChartBase.b();
            barLineChartBase.postInvalidate();
            if (((BarLineChartBase) this.e).a) {
                StringBuilder g = c.b.a.a.a.g("Double-Tap, Zooming In, x: ");
                g.append(b.b);
                g.append(", y: ");
                g.append(b.c);
                Log.i("BarlineChartTouch", g.toString());
            }
            d.d.c(b);
        }
        return super.onDoubleTap(motionEvent);
    }

    public boolean onFling(MotionEvent motionEvent, MotionEvent motionEvent2, float f, float f2) {
        this.a = c.d.a.a.h.b.a.FLING;
        c onChartGestureListener = ((BarLineChartBase) this.e).getOnChartGestureListener();
        if (onChartGestureListener != null) {
            onChartGestureListener.e(motionEvent, motionEvent2, f, f2);
        }
        return super.onFling(motionEvent, motionEvent2, f, f2);
    }

    public void onLongPress(MotionEvent motionEvent) {
        this.a = c.d.a.a.h.b.a.LONG_PRESS;
        c onChartGestureListener = ((BarLineChartBase) this.e).getOnChartGestureListener();
        if (onChartGestureListener != null) {
            onChartGestureListener.h(motionEvent);
        }
    }

    public boolean onSingleTapUp(MotionEvent motionEvent) {
        this.a = c.d.a.a.h.b.a.SINGLE_TAP;
        c onChartGestureListener = ((BarLineChartBase) this.e).getOnChartGestureListener();
        if (onChartGestureListener != null) {
            onChartGestureListener.f(motionEvent);
        }
        BarLineChartBase barLineChartBase = (BarLineChartBase) this.e;
        if (!barLineChartBase.c) {
            return false;
        }
        a(barLineChartBase.f(motionEvent.getX(), motionEvent.getY()));
        return super.onSingleTapUp(motionEvent);
    }

    /* JADX WARNING: Missing block: B:97:0x01cf, code skipped:
            if (r0 == null) goto L_0x01d1;
     */
    @android.annotation.SuppressLint({"ClickableViewAccessibility"})
    public boolean onTouch(android.view.View r12, android.view.MotionEvent r13) {
        /*
        r11 = this;
        r12 = c.d.a.a.h.b.a.DRAG;
        r0 = r11.n;
        if (r0 != 0) goto L_0x000c;
    L_0x0006:
        r0 = android.view.VelocityTracker.obtain();
        r11.n = r0;
    L_0x000c:
        r0 = r11.n;
        r0.addMovement(r13);
        r0 = r13.getActionMasked();
        r1 = 0;
        r2 = 3;
        if (r0 != r2) goto L_0x0022;
    L_0x0019:
        r0 = r11.n;
        if (r0 == 0) goto L_0x0022;
    L_0x001d:
        r0.recycle();
        r11.n = r1;
    L_0x0022:
        r0 = r11.b;
        if (r0 != 0) goto L_0x002b;
    L_0x0026:
        r0 = r11.d;
        r0.onTouchEvent(r13);
    L_0x002b:
        r0 = r11.e;
        r0 = (com.github.mikephil.charting.charts.BarLineChartBase) r0;
        r3 = r0.L;
        r4 = 0;
        r5 = 1;
        if (r3 != 0) goto L_0x003c;
    L_0x0035:
        r3 = r0.M;
        if (r3 == 0) goto L_0x003a;
    L_0x0039:
        goto L_0x003c;
    L_0x003a:
        r3 = 0;
        goto L_0x003d;
    L_0x003c:
        r3 = 1;
    L_0x003d:
        if (r3 != 0) goto L_0x0048;
    L_0x003f:
        r3 = r0.N;
        if (r3 != 0) goto L_0x0048;
    L_0x0043:
        r0 = r0.O;
        if (r0 != 0) goto L_0x0048;
    L_0x0047:
        return r5;
    L_0x0048:
        r0 = r13.getAction();
        r0 = r0 & 255;
        if (r0 == 0) goto L_0x041c;
    L_0x0050:
        r3 = 1000; // 0x3e8 float:1.401E-42 double:4.94E-321;
        r6 = 5;
        r7 = 4;
        r8 = 2;
        if (r0 == r5) goto L_0x0384;
    L_0x0057:
        r1 = 0;
        if (r0 == r8) goto L_0x012f;
    L_0x005a:
        if (r0 == r2) goto L_0x011e;
    L_0x005c:
        if (r0 == r6) goto L_0x00a4;
    L_0x005e:
        r12 = 6;
        if (r0 == r12) goto L_0x0063;
    L_0x0061:
        goto L_0x042f;
    L_0x0063:
        r12 = r11.n;
        r0 = c.d.a.a.j.g.c;
        r0 = (float) r0;
        r12.computeCurrentVelocity(r3, r0);
        r0 = r13.getActionIndex();
        r2 = r13.getPointerId(r0);
        r3 = r12.getXVelocity(r2);
        r2 = r12.getYVelocity(r2);
        r7 = r13.getPointerCount();
    L_0x007f:
        if (r4 >= r7) goto L_0x00a0;
    L_0x0081:
        if (r4 != r0) goto L_0x0084;
    L_0x0083:
        goto L_0x009d;
    L_0x0084:
        r8 = r13.getPointerId(r4);
        r9 = r12.getXVelocity(r8);
        r9 = r9 * r3;
        r8 = r12.getYVelocity(r8);
        r8 = r8 * r2;
        r8 = r8 + r9;
        r8 = (r8 > r1 ? 1 : (r8 == r1 ? 0 : -1));
        if (r8 >= 0) goto L_0x009d;
    L_0x0099:
        r12.clear();
        goto L_0x00a0;
    L_0x009d:
        r4 = r4 + 1;
        goto L_0x007f;
    L_0x00a0:
        r11.b = r6;
        goto L_0x042f;
    L_0x00a4:
        r12 = r13.getPointerCount();
        if (r12 < r8) goto L_0x042f;
    L_0x00aa:
        r12 = r11.e;
        r12 = (com.github.mikephil.charting.charts.BarLineChartBase) r12;
        r12.c();
        r11.e(r13);
        r12 = r13.getX(r4);
        r0 = r13.getX(r5);
        r12 = r12 - r0;
        r12 = java.lang.Math.abs(r12);
        r11.j = r12;
        r12 = r13.getY(r4);
        r0 = r13.getY(r5);
        r12 = r12 - r0;
        r12 = java.lang.Math.abs(r12);
        r11.k = r12;
        r12 = f(r13);
        r11.l = r12;
        r0 = 1092616192; // 0x41200000 float:10.0 double:5.398241246E-315;
        r12 = (r12 > r0 ? 1 : (r12 == r0 ? 0 : -1));
        if (r12 <= 0) goto L_0x0100;
    L_0x00de:
        r12 = r11.e;
        r12 = (com.github.mikephil.charting.charts.BarLineChartBase) r12;
        r0 = r12.I;
        if (r0 == 0) goto L_0x00e9;
    L_0x00e6:
        r11.b = r7;
        goto L_0x0100;
    L_0x00e9:
        r0 = r12.N;
        r12 = r12.O;
        if (r0 == r12) goto L_0x00f5;
    L_0x00ef:
        if (r0 == 0) goto L_0x00f2;
    L_0x00f1:
        r2 = 2;
    L_0x00f2:
        r11.b = r2;
        goto L_0x0100;
    L_0x00f5:
        r12 = r11.j;
        r0 = r11.k;
        r12 = (r12 > r0 ? 1 : (r12 == r0 ? 0 : -1));
        if (r12 <= 0) goto L_0x00fe;
    L_0x00fd:
        r2 = 2;
    L_0x00fe:
        r11.b = r2;
    L_0x0100:
        r12 = r11.i;
        r0 = r13.getX(r4);
        r1 = r13.getX(r5);
        r1 = r1 + r0;
        r0 = r13.getY(r4);
        r13 = r13.getY(r5);
        r13 = r13 + r0;
        r0 = 1073741824; // 0x40000000 float:2.0 double:5.304989477E-315;
        r1 = r1 / r0;
        r12.b = r1;
        r13 = r13 / r0;
        r12.c = r13;
        goto L_0x042f;
    L_0x011e:
        r11.b = r4;
        r12 = r11.e;
        r12 = r12.getOnChartGestureListener();
        if (r12 == 0) goto L_0x042f;
    L_0x0128:
        r0 = r11.a;
        r12.g(r13, r0);
        goto L_0x042f;
    L_0x012f:
        r0 = r11.b;
        if (r0 != r5) goto L_0x0164;
    L_0x0133:
        r12 = r11.e;
        r12 = (com.github.mikephil.charting.charts.BarLineChartBase) r12;
        r12.c();
        r12 = r11.e;
        r12 = (com.github.mikephil.charting.charts.BarLineChartBase) r12;
        r12 = r12.L;
        if (r12 == 0) goto L_0x014c;
    L_0x0142:
        r12 = r13.getX();
        r0 = r11.h;
        r0 = r0.b;
        r12 = r12 - r0;
        goto L_0x014d;
    L_0x014c:
        r12 = 0;
    L_0x014d:
        r0 = r11.e;
        r0 = (com.github.mikephil.charting.charts.BarLineChartBase) r0;
        r0 = r0.M;
        if (r0 == 0) goto L_0x015f;
    L_0x0155:
        r0 = r13.getY();
        r1 = r11.h;
        r1 = r1.c;
        r1 = r0 - r1;
    L_0x015f:
        r11.d(r13, r12, r1);
        goto L_0x042f;
    L_0x0164:
        if (r0 == r8) goto L_0x0235;
    L_0x0166:
        if (r0 == r2) goto L_0x0235;
    L_0x0168:
        if (r0 != r7) goto L_0x016c;
    L_0x016a:
        goto L_0x0235;
    L_0x016c:
        if (r0 != 0) goto L_0x042f;
    L_0x016e:
        r0 = r13.getX();
        r2 = r11.h;
        r2 = r2.b;
        r3 = r13.getY();
        r6 = r11.h;
        r6 = r6.c;
        r0 = r0 - r2;
        r3 = r3 - r6;
        r0 = r0 * r0;
        r3 = r3 * r3;
        r3 = r3 + r0;
        r2 = (double) r3;
        r2 = java.lang.Math.sqrt(r2);
        r0 = (float) r2;
        r0 = java.lang.Math.abs(r0);
        r2 = r11.r;
        r0 = (r0 > r2 ? 1 : (r0 == r2 ? 0 : -1));
        if (r0 <= 0) goto L_0x042f;
    L_0x0195:
        r0 = r11.e;
        r0 = (com.github.mikephil.charting.charts.BarLineChartBase) r0;
        r2 = r0.L;
        if (r2 != 0) goto L_0x01a4;
    L_0x019d:
        r2 = r0.M;
        if (r2 == 0) goto L_0x01a2;
    L_0x01a1:
        goto L_0x01a4;
    L_0x01a2:
        r2 = 0;
        goto L_0x01a5;
    L_0x01a4:
        r2 = 1;
    L_0x01a5:
        if (r2 == 0) goto L_0x042f;
    L_0x01a7:
        r0 = r0.t;
        r2 = r0.c();
        if (r2 == 0) goto L_0x01b7;
    L_0x01af:
        r0 = r0.d();
        if (r0 == 0) goto L_0x01b7;
    L_0x01b5:
        r0 = 1;
        goto L_0x01b8;
    L_0x01b7:
        r0 = 0;
    L_0x01b8:
        if (r0 == 0) goto L_0x01d1;
    L_0x01ba:
        r0 = r11.e;
        r0 = (com.github.mikephil.charting.charts.BarLineChartBase) r0;
        r0 = r0.t;
        r2 = r0.m;
        r2 = (r2 > r1 ? 1 : (r2 == r1 ? 0 : -1));
        if (r2 > 0) goto L_0x01ce;
    L_0x01c6:
        r0 = r0.n;
        r0 = (r0 > r1 ? 1 : (r0 == r1 ? 0 : -1));
        if (r0 > 0) goto L_0x01ce;
    L_0x01cc:
        r0 = 1;
        goto L_0x01cf;
    L_0x01ce:
        r0 = 0;
    L_0x01cf:
        if (r0 != 0) goto L_0x01d2;
    L_0x01d1:
        r4 = 1;
    L_0x01d2:
        if (r4 == 0) goto L_0x0208;
    L_0x01d4:
        r0 = r13.getX();
        r1 = r11.h;
        r1 = r1.b;
        r0 = r0 - r1;
        r0 = java.lang.Math.abs(r0);
        r13 = r13.getY();
        r1 = r11.h;
        r1 = r1.c;
        r13 = r13 - r1;
        r13 = java.lang.Math.abs(r13);
        r1 = r11.e;
        r1 = (com.github.mikephil.charting.charts.BarLineChartBase) r1;
        r2 = r1.L;
        if (r2 != 0) goto L_0x01fa;
    L_0x01f6:
        r2 = (r13 > r0 ? 1 : (r13 == r0 ? 0 : -1));
        if (r2 < 0) goto L_0x042f;
    L_0x01fa:
        r1 = r1.M;
        if (r1 != 0) goto L_0x0202;
    L_0x01fe:
        r13 = (r13 > r0 ? 1 : (r13 == r0 ? 0 : -1));
        if (r13 > 0) goto L_0x042f;
    L_0x0202:
        r11.a = r12;
        r11.b = r5;
        goto L_0x042f;
    L_0x0208:
        r0 = r11.e;
        r0 = (com.github.mikephil.charting.charts.BarLineChartBase) r0;
        r1 = r0.K;
        if (r1 == 0) goto L_0x042f;
    L_0x0210:
        r11.a = r12;
        if (r1 == 0) goto L_0x042f;
    L_0x0214:
        r12 = r13.getX();
        r13 = r13.getY();
        r12 = r0.f(r12, r13);
        if (r12 == 0) goto L_0x042f;
    L_0x0222:
        r13 = r11.c;
        r13 = r12.a(r13);
        if (r13 != 0) goto L_0x042f;
    L_0x022a:
        r11.c = r12;
        r13 = r11.e;
        r13 = (com.github.mikephil.charting.charts.BarLineChartBase) r13;
        r13.h(r12, r5);
        goto L_0x042f;
    L_0x0235:
        r12 = r11.e;
        r12 = (com.github.mikephil.charting.charts.BarLineChartBase) r12;
        r12.c();
        r12 = r11.e;
        r12 = (com.github.mikephil.charting.charts.BarLineChartBase) r12;
        r0 = r12.N;
        if (r0 != 0) goto L_0x0248;
    L_0x0244:
        r12 = r12.O;
        if (r12 == 0) goto L_0x042f;
    L_0x0248:
        r12 = r13.getPointerCount();
        if (r12 < r8) goto L_0x042f;
    L_0x024e:
        r12 = r11.e;
        r12 = (com.github.mikephil.charting.charts.BarLineChartBase) r12;
        r12 = r12.getOnChartGestureListener();
        r0 = f(r13);
        r1 = r11.s;
        r1 = (r0 > r1 ? 1 : (r0 == r1 ? 0 : -1));
        if (r1 <= 0) goto L_0x042f;
    L_0x0260:
        r1 = r11.i;
        r3 = r1.b;
        r1 = r1.c;
        r1 = r11.b(r3, r1);
        r3 = r11.e;
        r3 = (com.github.mikephil.charting.charts.BarLineChartBase) r3;
        r3 = r3.getViewPortHandler();
        r6 = r11.b;
        r9 = 1065353216; // 0x3f800000 float:1.0 double:5.263544247E-315;
        if (r6 != r7) goto L_0x02dc;
    L_0x0278:
        r2 = c.d.a.a.h.b.a.PINCH_ZOOM;
        r11.a = r2;
        r2 = r11.l;
        r0 = r0 / r2;
        r2 = (r0 > r9 ? 1 : (r0 == r9 ? 0 : -1));
        if (r2 >= 0) goto L_0x0285;
    L_0x0283:
        r2 = 1;
        goto L_0x0286;
    L_0x0285:
        r2 = 0;
    L_0x0286:
        if (r2 == 0) goto L_0x0291;
    L_0x0288:
        r6 = r3.i;
        r7 = r3.g;
        r6 = (r6 > r7 ? 1 : (r6 == r7 ? 0 : -1));
        if (r6 <= 0) goto L_0x029b;
    L_0x0290:
        goto L_0x0299;
    L_0x0291:
        r6 = r3.i;
        r7 = r3.h;
        r6 = (r6 > r7 ? 1 : (r6 == r7 ? 0 : -1));
        if (r6 >= 0) goto L_0x029b;
    L_0x0299:
        r6 = 1;
        goto L_0x029c;
    L_0x029b:
        r6 = 0;
    L_0x029c:
        if (r2 == 0) goto L_0x02a7;
    L_0x029e:
        r2 = r3.j;
        r3 = r3.e;
        r2 = (r2 > r3 ? 1 : (r2 == r3 ? 0 : -1));
        if (r2 <= 0) goto L_0x02b0;
    L_0x02a6:
        goto L_0x02af;
    L_0x02a7:
        r2 = r3.j;
        r3 = r3.f;
        r2 = (r2 > r3 ? 1 : (r2 == r3 ? 0 : -1));
        if (r2 >= 0) goto L_0x02b0;
    L_0x02af:
        r4 = 1;
    L_0x02b0:
        r2 = r11.e;
        r2 = (com.github.mikephil.charting.charts.BarLineChartBase) r2;
        r3 = r2.N;
        if (r3 == 0) goto L_0x02ba;
    L_0x02b8:
        r3 = r0;
        goto L_0x02bc;
    L_0x02ba:
        r3 = 1065353216; // 0x3f800000 float:1.0 double:5.263544247E-315;
    L_0x02bc:
        r2 = r2.O;
        if (r2 == 0) goto L_0x02c1;
    L_0x02c0:
        r9 = r0;
    L_0x02c1:
        if (r4 != 0) goto L_0x02c5;
    L_0x02c3:
        if (r6 == 0) goto L_0x037d;
    L_0x02c5:
        r0 = r11.f;
        r2 = r11.g;
        r0.set(r2);
        r0 = r11.f;
        r2 = r1.b;
        r4 = r1.c;
        r0.postScale(r3, r9, r2, r4);
        if (r12 == 0) goto L_0x037d;
    L_0x02d7:
        r12.c(r13, r3, r9);
        goto L_0x037d;
    L_0x02dc:
        if (r6 != r8) goto L_0x032d;
    L_0x02de:
        r0 = r11.e;
        r0 = (com.github.mikephil.charting.charts.BarLineChartBase) r0;
        r0 = r0.N;
        if (r0 == 0) goto L_0x032d;
    L_0x02e6:
        r0 = c.d.a.a.h.b.a.X_ZOOM;
        r11.a = r0;
        r0 = r13.getX(r4);
        r2 = r13.getX(r5);
        r0 = r0 - r2;
        r0 = java.lang.Math.abs(r0);
        r2 = r11.j;
        r0 = r0 / r2;
        r2 = (r0 > r9 ? 1 : (r0 == r9 ? 0 : -1));
        if (r2 >= 0) goto L_0x0300;
    L_0x02fe:
        r2 = 1;
        goto L_0x0301;
    L_0x0300:
        r2 = 0;
    L_0x0301:
        if (r2 == 0) goto L_0x030c;
    L_0x0303:
        r2 = r3.i;
        r3 = r3.g;
        r2 = (r2 > r3 ? 1 : (r2 == r3 ? 0 : -1));
        if (r2 <= 0) goto L_0x0315;
    L_0x030b:
        goto L_0x0314;
    L_0x030c:
        r2 = r3.i;
        r3 = r3.h;
        r2 = (r2 > r3 ? 1 : (r2 == r3 ? 0 : -1));
        if (r2 >= 0) goto L_0x0315;
    L_0x0314:
        r4 = 1;
    L_0x0315:
        if (r4 == 0) goto L_0x037d;
    L_0x0317:
        r2 = r11.f;
        r3 = r11.g;
        r2.set(r3);
        r2 = r11.f;
        r3 = r1.b;
        r4 = r1.c;
        r2.postScale(r0, r9, r3, r4);
        if (r12 == 0) goto L_0x037d;
    L_0x0329:
        r12.c(r13, r0, r9);
        goto L_0x037d;
    L_0x032d:
        if (r6 != r2) goto L_0x037d;
    L_0x032f:
        r0 = r11.e;
        r0 = (com.github.mikephil.charting.charts.BarLineChartBase) r0;
        r0 = r0.O;
        if (r0 == 0) goto L_0x037d;
    L_0x0337:
        r0 = c.d.a.a.h.b.a.Y_ZOOM;
        r11.a = r0;
        r0 = r13.getY(r4);
        r2 = r13.getY(r5);
        r0 = r0 - r2;
        r0 = java.lang.Math.abs(r0);
        r2 = r11.k;
        r0 = r0 / r2;
        r2 = (r0 > r9 ? 1 : (r0 == r9 ? 0 : -1));
        if (r2 >= 0) goto L_0x0351;
    L_0x034f:
        r2 = 1;
        goto L_0x0352;
    L_0x0351:
        r2 = 0;
    L_0x0352:
        if (r2 == 0) goto L_0x035d;
    L_0x0354:
        r2 = r3.j;
        r3 = r3.e;
        r2 = (r2 > r3 ? 1 : (r2 == r3 ? 0 : -1));
        if (r2 <= 0) goto L_0x0366;
    L_0x035c:
        goto L_0x0365;
    L_0x035d:
        r2 = r3.j;
        r3 = r3.f;
        r2 = (r2 > r3 ? 1 : (r2 == r3 ? 0 : -1));
        if (r2 >= 0) goto L_0x0366;
    L_0x0365:
        r4 = 1;
    L_0x0366:
        if (r4 == 0) goto L_0x037d;
    L_0x0368:
        r2 = r11.f;
        r3 = r11.g;
        r2.set(r3);
        r2 = r11.f;
        r3 = r1.b;
        r4 = r1.c;
        r2.postScale(r9, r0, r3, r4);
        if (r12 == 0) goto L_0x037d;
    L_0x037a:
        r12.c(r13, r9, r0);
    L_0x037d:
        r12 = c.d.a.a.j.d.d;
        r12.c(r1);
        goto L_0x042f;
    L_0x0384:
        r12 = r11.n;
        r0 = r13.getPointerId(r4);
        r9 = c.d.a.a.j.g.c;
        r9 = (float) r9;
        r12.computeCurrentVelocity(r3, r9);
        r3 = r12.getYVelocity(r0);
        r12 = r12.getXVelocity(r0);
        r0 = java.lang.Math.abs(r12);
        r9 = c.d.a.a.j.g.b;
        r9 = (float) r9;
        r0 = (r0 > r9 ? 1 : (r0 == r9 ? 0 : -1));
        if (r0 > 0) goto L_0x03ae;
    L_0x03a3:
        r0 = java.lang.Math.abs(r3);
        r9 = c.d.a.a.j.g.b;
        r9 = (float) r9;
        r0 = (r0 > r9 ? 1 : (r0 == r9 ? 0 : -1));
        if (r0 <= 0) goto L_0x03de;
    L_0x03ae:
        r0 = r11.b;
        if (r0 != r5) goto L_0x03de;
    L_0x03b2:
        r0 = r11.e;
        r0 = (com.github.mikephil.charting.charts.BarLineChartBase) r0;
        r0 = r0.d;
        if (r0 == 0) goto L_0x03de;
    L_0x03ba:
        r11.g();
        r9 = android.view.animation.AnimationUtils.currentAnimationTimeMillis();
        r11.o = r9;
        r0 = r11.p;
        r9 = r13.getX();
        r0.b = r9;
        r0 = r11.p;
        r9 = r13.getY();
        r0.c = r9;
        r0 = r11.q;
        r0.b = r12;
        r0.c = r3;
        r12 = r11.e;
        r12.postInvalidateOnAnimation();
    L_0x03de:
        r12 = r11.b;
        if (r12 == r8) goto L_0x03e8;
    L_0x03e2:
        if (r12 == r2) goto L_0x03e8;
    L_0x03e4:
        if (r12 == r7) goto L_0x03e8;
    L_0x03e6:
        if (r12 != r6) goto L_0x03f6;
    L_0x03e8:
        r12 = r11.e;
        r12 = (com.github.mikephil.charting.charts.BarLineChartBase) r12;
        r12.b();
        r12 = r11.e;
        r12 = (com.github.mikephil.charting.charts.BarLineChartBase) r12;
        r12.postInvalidate();
    L_0x03f6:
        r11.b = r4;
        r12 = r11.e;
        r12 = (com.github.mikephil.charting.charts.BarLineChartBase) r12;
        r12 = r12.getParent();
        if (r12 == 0) goto L_0x0405;
    L_0x0402:
        r12.requestDisallowInterceptTouchEvent(r4);
    L_0x0405:
        r12 = r11.n;
        if (r12 == 0) goto L_0x040e;
    L_0x0409:
        r12.recycle();
        r11.n = r1;
    L_0x040e:
        r12 = r11.e;
        r12 = r12.getOnChartGestureListener();
        if (r12 == 0) goto L_0x042f;
    L_0x0416:
        r0 = r11.a;
        r12.g(r13, r0);
        goto L_0x042f;
    L_0x041c:
        r12 = r11.e;
        r12 = r12.getOnChartGestureListener();
        if (r12 == 0) goto L_0x0429;
    L_0x0424:
        r0 = r11.a;
        r12.a(r13, r0);
    L_0x0429:
        r11.g();
        r11.e(r13);
    L_0x042f:
        r12 = r11.e;
        r12 = (com.github.mikephil.charting.charts.BarLineChartBase) r12;
        r12 = r12.getViewPortHandler();
        r13 = r11.f;
        r0 = r11.e;
        r12.n(r13, r0, r5);
        r11.f = r13;
        return r5;
        */
        throw new UnsupportedOperationException("Method not decompiled: c.d.a.a.h.a.onTouch(android.view.View, android.view.MotionEvent):boolean");
    }
}
